#!/usr/bin/bash

pb="pb"
if [ ! -d "$pb" ]; then
	mkdir $pb
fi


cd proto
#找到文件夹下的所有proto文件
protofiles=`ls | grep [.]proto`
cd ../

for f in ${protofiles[*]}
do
    chmod u+x ./protoc
    ./protoc "proto/"$f -o "pb/"${f/".proto"/".pb"}

    echo "create:" ${f/".proto"/".pb"} ok
done


# cp -f *.pb pb
rm -f *.pb
